﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CinemaMaestro.WebApplication.Models
{
    public class ActorViewModels
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime BirthDay { get; set; }
        public byte[] Image { get; set; }

        public static implicit operator ActorViewModels(Actor actor)
        {
            return new ActorViewModels
            {
                Id = actor.Id,
                FirstName = actor.FirstName,
                LastName = actor.LastName,
                BirthDay = actor.BirthDay,
                Image = actor.Image
            };
        }

        public static implicit operator Actor(ActorViewModels actorVM)
        {
            return new Actor
            {
                Id = actorVM.Id,
                FirstName = actorVM.FirstName,
                LastName = actorVM.LastName,
                BirthDay = actorVM.BirthDay,
                Image = actorVM.Image
            };
        }     
    }
}